package kr.ac.skhu.m.service;

import java.sql.SQLException;
import java.util.List;

import kr.ac.skhu.m.dao.UsedD;
import kr.ac.skhu.m.domain.Comment;
import kr.ac.skhu.m.domain.Used;

public class UsedS {

	private UsedD usedD;

	public void setUsedD(UsedD usedD) {
		this.usedD = usedD;
	}
	
	public List<Used> getUsedList(int pageNum) {
		
		List<Used> list = null;
		
		try {
			list = usedD.getUsedList(pageNum);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return list;
	}
	
	public int getTotalPage() {
		
		int totalPage = 0;
		
		try {
			totalPage = usedD.getTotalPage();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
		return totalPage;
	}
	
	public Used getUsed(String aNo) {
		
		Used used = null;
		
		try {
			used = usedD.getUsed(aNo);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
		return used;
		
	}
	
	public List<Comment> getCommentList(String aNo) {
		
		List<Comment> list = null;
		
		try {
			list = usedD.getCommentList(aNo);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
		return list;
		
	}
	
}
